/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：AATree.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-04-18
Function List ：
Description   ：AA-Tree
******************************************************/

#ifndef AATREE_H_
#define AATREE_H_

// Type Definition
struct AANode;
typedef int ElementType;
typedef struct AANode *Position;
typedef struct AANode *AATree;

// Function Lists
AATree Initialize(void);
AATree MakeEmpty(AATree T);
int IsEmpty(AATree T);
Position Find(ElementType X, AATree T);
Position FindMin(AATree T);
Position FindMax(AATree T);
AATree Insert(ElementType X, AATree T);
AATree Delete(ElementType X, AATree T);
Position Left(Position P);
Position Right(Position P);
ElementType Retrieve(Position P);
void PreorderTraversal(AATree T);
void InorderTraversal(AATree T);
void PostorderTraversal(AATree T);
void LevelorderTraversal(AATree T);

#endif  /* AATREE_H_ */

// EOF

